package edu.njpi.vueajax.service.impl;

import edu.njpi.vueajax.mapper.ProductMapper;
import edu.njpi.vueajax.model.Product;
import edu.njpi.vueajax.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class ProductServiceImpl implements ProductService {
    @Autowired
    private ProductMapper productMapper;
    @Override
    public List<Product> getAllProducts() {
        return productMapper.getAllProducts();
    }

    @Override
    public boolean saveProduct(String name) {
        return productMapper.saveProduct(name);
    }

    @Override
    public boolean deleteProductById(int id) {
        return productMapper.deleteProductById(id);
    }

}
